package cn.dg.manager.base.entity;

public class HttpResult {
    private String message; 	// 消息
    private boolean isSuccess; 	// 成功否
    private Object data; 		// 数据
    private String rslt_flag; 	// 执行结果分类
    
    /**
     * 
     * @param message
     * @param success
     * @param data
     */
	public HttpResult(String message, boolean isSuccess, Object data, String rslt_flag) {
		super();
		this.message = message;
		this.rslt_flag = rslt_flag;
		this.isSuccess = isSuccess;
		this.data = data;
	}

	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @param message the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}


	/**
	 * @return the data
	 */
	public Object getData() {
		return data;
	}

	/**
	 * @param data the data to set
	 */
	public void setData(Object data) {
		this.data = data;
	}
    
    /**
	 * @return the rslt_flag
	 */
	public String getRslt_flag() {
		return rslt_flag;
	}

	/**
	 * @param rslt_flag the rslt_flag to set
	 */
	public void setRslt_flag(String rslt_flag) {
		this.rslt_flag = rslt_flag;
	}
	
	/**
     * 
     * @param message
     * @param data
     * @return
     */
    public static HttpResult createErrorResult(String message, Object data, String rslt_flag) {
        return new HttpResult(message, false, data, rslt_flag);
    }
    
	/**
	 * @return the isSuccess
	 */
	public boolean getIsSuccess() {
		return isSuccess;
	}

	/**
	 * @param isSuccess the isSuccess to set
	 */
	public void setIsSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	/**
	 * 
	 * @param data
	 * @return
	 */
    public static HttpResult createSuccessResult(Object data, String rslt_flag) {
        return new HttpResult("", true, data, rslt_flag);
    }
}
